<%@ page contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);%>

<jsp:useBean id="action" scope="request" class="com.pubpage.user_group_maintain.Action" />
<jsp:useBean id="view" scope="request" class="com.pubpage.user_group_maintain.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")) {return;} %>
<jsp:useBean id="DataView" scope="request" type="com.pub.database.DataView"/>
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request" type="com.pub.database.DataViewForm"/>
<jsp:setProperty name="DataViewForm" property="submitMethod" value="POST"/>
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="100"/>
<jsp:setProperty name="DataViewForm" property="nowPageNum"/>
<jsp:setProperty name="DataViewForm" property="dataViewAction"/>
<jsp:setProperty name="DataViewForm" property="filterCol"/>
<jsp:setProperty name="DataViewForm" property="filterValue"/>
<jsp:setProperty name="DataViewForm" property="dvOrderByFields"/>
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq"/>
<!-- DataView 設定結束 -->

<html>
<head>
<base target='_self'/>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/PUBPAGE/general/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2" src="/PUBPAGE/general/commscript.js" ></script>
</head>
<script language="javascript" type="">
    function saveRowSn(rowsn){
       if(document.all.item('rowsn').value.indexOf(rowsn)>-1){
          return;//已記錄過就不再記錄了
       }
       if(document.all.item('rowsn').value==''){
         document.all.item('rowsn').value=rowsn;
       } else{
         document.all.item('rowsn').value=document.all.item('rowsn').value + ',' + rowsn;
       }
    }

    function fc_save_before_check(){
         // 工號
         if (document.all.item('user_no').value==""){
            alert("工號沒有值!!");
            return;
         }

         document.all.item('prgAction').value='save';
         document.forms[0].submit();
    }

      function fc_ins_before_check(){


       document.all.item('prgAction').value='add';
       document.forms[0].submit();
    }
function getEmpData(DB_ALIAS,DEBUG,SOURCE_CHARSET,TARGET_CHARSET){
    { ret=window.showModalDialog("/PUBPAGE/find_employee.jsp?DB_ALIAS="+DB_ALIAS+"&DEBUG="+DEBUG+"&SOURCE_CHARSET="+SOURCE_CHARSET+"&TARGET_CHARSET="+TARGET_CHARSET,"_blank");}
    if(ret==null){return;}
    val=ret.split(',');
    document.all.item("user_no").value=val[0];
    document.all.item("username").value=val[1];
  }

</script>
<body bgcolor="#ffffff" onLoad="<%=view.getOnloadScript()%>">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
<TR><TD  BACKGROUND="pub_images/title/title_bg.gif"><DIV ALIGN="LEFT"><IMG SRC="pub_images/title/title01.gif" WIDTH="18" HEIGHT="24" HSPACE="0" alt=""/><IMG SRC="pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt=""/></DIV></TD>
<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE" BACKGROUND="pub_images/title/title_bg.gif" CLASS="TITLE"><%=view.getPrgTitle()%></TD>
<TD BACKGROUND="pub_images/title/title_bg.gif"><DIV ALIGN="RIGHT"><IMG SRC="pub_images/title/glass.gif" WIDTH="12" HEIGHT="8" alt=""/><IMG SRC="pub_images/title/title02.gif" WIDTH="18" HEIGHT="24" HSPACE="0" alt=""/></DIV></TD>
</TR></TABLE><br/>
<form action="user_group_maintain.jsp" method="POST">

<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="1">
<TR >
<TD style="DISPLAY='<%=view.getBtnAddShow()%>'"><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnAddTitle()%>" CLASS="button b_normal" ONCLICK="javascript:fc_ins_before_check();"/></TD>
<TD style="DISPLAY='<%=view.getBtnSaveShow()%>'" ><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal" ONCLICK="javascript:fc_save_before_check();"/></TD>
<TD style="DISPLAY='<%=view.getBtnQueryShow()%>'"><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal" ONCLICK="javascript:document.all.item('prgAction').value='query';document.forms[0].submit();"/></TD>
<TD style="DISPLAY='<%=view.getBtnExitShow()%>'" ><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnExitTitle()%>" CLASS="button b_normal" ONCLICK="javascript:document.all.item('prgAction').value='exit';document.forms[0].submit();"/></TD>

</TR >
</TABLE >
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0"  >
<TR  style="DISPLAY='<%=view.getInsertShow()%>'">
<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getuser_no_readonly()? "" : "<img src=\"pub_images/star.gif\">"%><%=view.getuser_noTitle()%></TD>
<TD WIDTH="80%" CLASS="td_content" >
  <INPUT TYPE="TEXT" NAME="user_no" SIZE="8" MAXLENGTH="8" VALUE="<%=(view.getuser_no()!=null ? view.getuser_no() : "")%>" <%=view.getuser_no_readonly() ? "readonly" :"onDblClick=getEmpData('"+view.getDBAlias()+"','"+view.getDBDebug()+"','"+view.getSourceCharset()+"','"+view.getTargetCharset()+"');" %> CLASS="<%=(view.getuser_no_readonly() ?  "input_noborder":"input_window hand")%>" onChange="javascript:fc_get_employee_data('<%=view.getDBAlias()%>',this,document.all.item('username'),'','');"  />
  <INPUT TYPE="TEXT" NAME="username" SIZE="10" MAXLENGTH="20" VALUE="<%=(view.getusername()!=null ? view.getusername() : "")%>" readonly CLASS="input_noborder"/>
</TD>
</TR>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
<INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
<INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />
<input type="hidden" name="DBAlias" value="<%=view.getDBAlias()%>">
<input type="hidden" name="DBDebug" value="<%=view.getDBDebug()%>">
<input type="hidden" name="SourceCharset" value="<%=view.getSourceCharset()%>">
<input type="hidden" name="TargetCharset" value="<%=view.getTargetCharset()%>">
<input type="hidden" name="sys" value="<%=view.getSys()%>">
<input type="hidden" name="ctl_id" value="<%=view.getCtl_id()%>">

<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0"  >
<tr>
<td>
<%=DataView.getOutputDataView(DataViewForm)%>
<%//DataView.OutputDataView(DataViewForm, pageContext);  %>

</td>
</tr>
</TABLE>

</form>
</body>
</html>
